package com.learn.scrm;

import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.nio.charset.Charset;

/**
 * @author : Yu.Tan
 * @date : 2023/2/22 14:24
 * @desc : **
 */
public class SpareTest {
    public static void main(String[] args) {
        try {
            String  mockTxt = IOUtils.toString(ProductOption.class.getResourceAsStream("/json/Spare.json"), String.valueOf(Charset.defaultCharset()));

            System.out.println(mockTxt);
            JSON parse = JSONUtil.parse(mockTxt);
            String code = parse.getByPath("referralCode", String.class);
            System.out.println(code);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
